
#ifndef _TTG_UTILS_PARAMETERS_TYPESERIALIZER_
#define _TTG_UTILS_PARAMETERS_TYPESERIALIZER_
#include "Common/Definitions.h"

#include <string>
#include <vector>
#include "Common/Math.h"

namespace ttg_internal
{
	namespace utils
	{
		class TypeSerializer
		{
			public:
				enum ParameterType
				{
					Void,
					Bool,
					Int64,
					Double,
					String,
					Enum
				};
			public:
				//Creates serialization for type "Void".
				static inline std::string serializeVoid()
				{ return "Void"; }
				//Creates serialization for type "Bool".
				static inline std::string serializeBool()
				{ return "Bool"; }
				//Creates serialization for type "Int64" without boundaries.
				static inline std::string serializeInt64()
				{ return "Int64"; }
				//Creates serialization for type "Int64" with  boundaries required boundaries.
				static std::string serializeInt64(ttg::math::int64 lo, ttg::math::int64 hi);
				//Creates serialization for type "Double" without boundaries.
				static inline std::string serializeDouble()
				{ return "Double"; }
				//Creates serialization for type "Double" with  boundaries required boundaries.
				static std::string serializeDouble(double lo, double hi);
				//Creates serialization for type "String".
				static inline std::string serializeString()
				{ return "String"; }
				//Creates serialization for type "Enum" with required elements.
				static std::string serializeEnum(std::vector<std::string> &elements);
				//DeSerializes type without additional information.
				static ParameterType deserializeType(const char *type);
				//Tries to DeSerialize bounds of type. If it exists, returns true and stores it to "lo" and "hi".
				static bool deserializeInt64Bounds(const char *type,
												   ttg::math::int64 &lo,
												   ttg::math::int64 &hi);
				//Tries to DeSerialize bounds of type. If it exists, returns true and stores it to "lo" and "hi".
				static bool deserializeDoubleBounds(const char *type, double &lo, double &hi);
				//DeSerializes elements of enumeration.
				static std::vector<std::string> deserializeEnumElements(const char *type);
		};
	}
}

#endif
